#{extends 'main.html' /}
#{if isOldOffer}
#{set title:'Offer Edited' /}
#{/if}
#{else}
#{set title:'Offer Created' /}
#{/else}
#{set 'moreScripts'}
<script src="@{'/public/javascripts/gmaps.js'}" type="text/javascript" charset="${_response_encoding}"></script>
<script src="http://www.google.com/jsapi" type="text/javascript" charset="${_response_encoding}" ></script>
<script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyCG9Kc_QV1stkM1sPMZqdkPmXfb47u_HFc&sensor=false" type="text/javascript" charset="${_response_encoding}"  ></script>
#{/set}
<div id="content">
  <div id="main" style="padding-top:0px">
    <div class="post" style="padding:top:0px">
      <h3 style="padding-top:0px;">
	#{if isOldOffer}
	Your offer was successfully edited
	#{/if}
	#{else}
	Your offer was successfully created
	#{/else}
      </h3>
      <form>
	<ul class="long_login">
	  <li>
	    <label>Offer Title</label>
	    <input class="roinput" type="text" readonly="readonly" value="${offerItem.title}" />
	  </li>
	  <li>
	    <label>Offer Tags</label>
	    <input class="roinput" type="text" readonly="readonly" value="${offerItem.tags.join(' ')}" />
	  </li>
	  <li>
	    <label style="vertical-align: top; padding-top: 7px;">Description</label>
	    <textarea rows="4" class="roinput" readonly="readonly">${offerItem.description}</textarea>
	  </li>
	  <li>
	    <label>Social Credits Required</label>
	    <input class="roinput" type="text" readonly="readonly" value="${offerItem.getCredits().forRequester()}" />
	  </li>
	  	  <li>
	    <label>Duration</label>
	    <input class="roinput" type="text" readonly="readonly" value="${offerItem.duration}" />
	  </li>
	  <li>
	    <label>Is Virtual?</label>
	    <input id="txtVirtual" class="roinput" type="text" readonly="readonly" />
	    <input type="checkbox" style="visibility: hidden; display: none" id="chkVir" ${offerItem.isVirtual ? 'checked':''} />
	  </li>
	          <li>
        <label style="padding-top:7px">Number Of Participants</label>
        Min:${offerItem.minNumberOfParticipants} - Max:${offerItem.maxNumberOfParticipants}
      </li>
	   <li>
	    <label style="vertical-align: top; padding-top: 5px;">Valid Until</label>
	    #{if offerItem.endsAt}
	    <input class="roinput" type="text" readonly="readonly" value="${offerItem.endsAt.format('dd MMMM yyyy')}" />
	    #{/if}
        #{else}
        <input class="roinput" type="text" value="" />
       #{/else}
	  </li>	 
      	  <li>
	    <label style="width:150px;">Range</label>
	    ${offerItem.rangeFromLocation}
	    <input id="txt_range"  type="hidden" type="text" name="offerItem.rangeFromLocation" value="${offerItem.rangeFromLocation}" />  KM
        <input id="txt_location"  type="hidden" name="offerItem.location" value="${offerItem.location}" />
	  </li>
	  </ul>
           <div id="map_canvas" style="width:450px; height:280px"></div>	  
	  <input style="visibility:hidden; display:none" type="button" value="Home" onclick="window.location='@{Application.index()}'"/>
      </form>
    </div>
  </div>
</div>
	  <script>
	  	
	  	initialize();
	  	if(document.getElementById("chkVir").checked == 0)
	  	{	  		
	  		document.getElementById("txtVirtual").value = "No";	  		
	  	}
	  	else 
 		{
		 	document.getElementById("txtVirtual").value = "Yes";
	  	}
	  	
	  	function disableClick(input){
  		 input.checked == true ? input.checked = false : input.checked = true;
  		}
      </script>  